<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 不要用tr或者option作为组件的根元素 -->
      <h2>元素位置的限制</h2>
      <select name="" id="">
        <opt value="1" label="a"></opt>
        <opt value="2" label="b"></opt>
      </select>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      const Opt = {
        props: ["value", "label"],
        template: `
          <option :value="value">{{label}}</option>
        `,
      };

      createApp({
        data() {
          return {};
        },
        components: {
          Opt,
        },
      }).mount("#app");
    </script>
  </body>
</html>
